package com.Interface.TestIO;

import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;

public class test2 {
    public static void main(String[] args) throws Exception {
        File file = new File("D:\\JAVA\\schoolSystem\\src\\com\\Interface\\TestIO\\file\\test1");
        String path = "D:\\JAVA\\schoolSystem\\src\\com\\Interface\\TestIO\\file\\test1";

        //构造输入流实例
        InputStream inputStream = new FileInputStream(path);
//        int read = inputStream.read();
        //当inputStream.read()返回-1时说明，其已经拿到下一个字符，因此做如下操作
        //将read的值赋给count，打印(char)count
        int count = 0;
        while ((count = inputStream.read()) != -1){
            System.out.print((char) count);
        }


    }
}
